package com.app.yc.ifapp.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.math.BigDecimal;

/**
 * 作者：TanTun
 * 时间：2017/3/22
 * 邮箱：32965926@qq.com
 * 描述：卡片信息实体
 */

public class Card implements Parcelable {
    int cardId;
    BigDecimal cardValue;
    int cardStatusId;
    String validate;

    public int getCardId() {
        return cardId;
    }

    public void setCardId(int cardId) {
        this.cardId = cardId;
    }

    public BigDecimal getCardValue() {
        return cardValue;
    }

    public void setCardValue(BigDecimal cardValue) {
        this.cardValue = cardValue;
    }

    public int getCardStatusId() {
        return cardStatusId;
    }

    public void setCardStatusId(int cardStatusId) {
        this.cardStatusId = cardStatusId;
    }

    public String getValidate() {
        return validate;
    }

    public void setValidate(String validate) {
        this.validate = validate;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.cardId);
        dest.writeSerializable(this.cardValue);
        dest.writeInt(this.cardStatusId);
        dest.writeString(this.validate);
    }

    public Card() {
    }

    protected Card(Parcel in) {
        this.cardId = in.readInt();
        this.cardValue = (BigDecimal) in.readSerializable();
        this.cardStatusId = in.readInt();
        this.validate = in.readString();
    }

    public static final Parcelable.Creator<Card> CREATOR = new Parcelable.Creator<Card>() {
        @Override
        public Card createFromParcel(Parcel source) {
            return new Card(source);
        }

        @Override
        public Card[] newArray(int size) {
            return new Card[size];
        }
    };
}
